﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Grishko.DataTier;
using Grishko.SerilizeTools;

namespace OutdoorLib.BaseEntity.Infrastructure
{
    /// <summary>
    /// Описание странички 
    /// </summary>

    public  class SiteMapItem: EntitySingle 
    {
        [EntityNonSerialized]
        public string PageKey { get { return ID; } set { ID = value; } }
        public string Caption { get; set; }
        public string URL { get; set; }

        /// <summary>
        /// Признак того что страничка является закладкой
        /// </summary>
        public bool IsTabPage { get; set; }

        public string GetUrl_InsertCommand(string ObjectTagName,string ReturnUrlParam)
        {
            string format = "{0}?ID={3}&TagName={1}&ReturnUrlParam={2}";
            return string.Format(format, new string[] { URL, ObjectTagName, ReturnUrlParam, Guid .NewGuid ().ToString () });
        }

        public string GetUrl_EditCommand(string ObjectID,string ObjectTagName, string ReturnUrlParam)
        {
            string format = "{0}?ID={3}&TagName={1}&ReturnUrlParam={2}";
            return string.Format(format, new string[] { URL, ObjectTagName, ReturnUrlParam, ObjectID });
            
        }
        
    }
}
